import request from '@/utils/request'
// import { makeFormData } from '@/utils/util'

export const dailyApi = {
  dailyList: '/web/record/daily/multiple', // 保育列表
  temperature: 'web/record/temperature/daily_records', // 体温
  feeding: 'web/record/feeding/daily_records', // 喂食
  potty: 'web/record/potty/daily_records', // 大小便
  medication: 'web/record/medication/daily_records', // 服药
  sleep: 'web/record/sleep/daily_records', // 睡觉
  handover: 'web/record/handover/daily_records', // 药品交接
  dailyExport: 'web/daily/classCount' // 导出
}

export function getDailyList (params = {}) {
  return request({
    url: dailyApi.dailyList,
    method: 'get',
    params
  })
}

export function getTemperatureByChild (params = {}) {
  return request({
    url: dailyApi.temperature,
    method: 'get',
    params
  })
}

export function getFeedingByChild (params = {}) {
  return request({
    url: dailyApi.feeding,
    method: 'get',
    params
  })
}

export function getTePottyByChild (params = {}) {
  return request({
    url: dailyApi.potty,
    method: 'get',
    params
  })
}

export function getSleepByChild (params = {}) {
  return request({
    url: dailyApi.sleep,
    method: 'get',
    params
  })
}

export function getMedicationByChild (params = {}) {
  return request({
    url: dailyApi.medication,
    method: 'get',
    params
  })
}

export function getHandoverByChild (params = {}) {
  return request({
    url: dailyApi.handover,
    method: 'get',
    params
  })
}

export function getDailyExport (params = {}) {
  return request({
    url: dailyApi.dailyExport,
    method: 'get',
    params
  })
}

const attendanceApi = {
  listByClass: 'web/checkrecord/check_date_record_by_classId',
  infoByChildren: 'web/checkrecord/check_detail_by_childrenId',
  recordByChildren: 'web/checkrecord/check_record_by_childrenId',
  childrenCheckrRcords: 'web/checkrecord/children_checkrecords',
  classChildrenCheckList: 'web/classes/classChildrenCheckList',
  exportClassChildrenCheckList: 'web/classes/exportClassChildrenCheckList',
  nurseryInfoRecord: 'web/nurseryInfoRecord/getMonthInfo',
  exportClassChildrenCheckList2: 'web/nurseryInfoRecord/exportMonthInfoSheet',
  cancelRefuseCheckinStatus: 'web/checkrecord/cancel_refuse_checkin_status'
}

export function getAttendanceByClass (params = {}) {
  return request({
    url: attendanceApi.listByClass,
    method: 'post',
    params
  })
}

export function getAttendanceInfoByChildren (params = {}) {
  return request({
    url: attendanceApi.infoByChildren,
    method: 'post',
    params
  })
}

export function getAttendanceRecordByChildren (params = {}) {
  return request({
    url: attendanceApi.recordByChildren,
    method: 'post',
    params
  })
}

export function getChildrenCheckrRcords (params = {}) {
  return request({
    url: attendanceApi.childrenCheckrRcords,
    method: 'post',
    params
  })
}

export function getClassChildrenCheckList (params = {}) {
  return request({
    url: attendanceApi.classChildrenCheckList,
    method: 'post',
    params
  })
}

export function exportClassChildrenCheckList (params = {}) {
  return request({
    url: attendanceApi.exportClassChildrenCheckList,
    method: 'post',
    params
  })
}

export function getMonthClassCheck (params = {}) {
  return request({
    url: attendanceApi.nurseryInfoRecord,
    method: 'post',
    params
  })
}

export function exportClassChildrenCheckList2 (params = {}) {
  return request({
    url: attendanceApi.exportClassChildrenCheckList2,
    method: 'post',
    params
  })
}

export function cancelRefuseCheckinStatus (params = {}) {
  return request({
    url: attendanceApi.cancelRefuseCheckinStatus,
    method: 'post',
    params
  })
}
